package com.scau.hwadee.examination.mapper;

import com.scau.hwadee.examination.entity.Major;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author YHX
 * @date 2019/7/29  9:02
 * @description
 */
public interface MajorMapper {
    int deleteByPrimaryKey(String mjId);

    int insert(Major record);

    int insertSelective(Major record);

    Major selectByPrimaryKey(String mjId);

    List<Major> selectAllMajors2ExportExcel();

    int updateByPrimaryKeySelective(Major record);

    int updateByPrimaryKey(Major record);

    int insertMajorList(@Param("list") List<Major> majors);

    List<Major> selectAllDisableMajor(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    List<Major> selectAllEnableMajor(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    List<Major> selectAllMajor(@Param("pageNum") int pageNum,
                               @Param("pageSize") int pageSize);

    int updateMajorDisableOrEnable(@Param("list") List<Major> majors);

    int setSubjectSchoolOfMajorByMajorId(@Param("schoolName") String schoolName,
                                         @Param("majorId") String majorId);

    List<Major> selectAllMajorByMajorPlanVersionAndMajorState(@Param("pageNum") int pageNum,
                                                              @Param("pageSize") int pageSize,
                                                              @Param("majorVersionId") String majorVersionId,
                                                              @Param("state") String state);

    List<Major> selectAllMajorByExamSessionId(@Param("pageNum") int pageNum,
                                              @Param("pageSize") int pageSize,
                                              @Param("list") List<String> majorId);

    /**
     * @return java.util.List<com.scau.hwadee.examination.entity.Major>
     * @author YHX
     * @description 查找该主考院校下的所有专业
     * @date 14:32 2019/8/3
     * @Param [schoolId]
     **/
    List<Major> selectAllMajorsOfSchool(@Param("pageNum") int pageNum,
                                        @Param("pageSize") int pageSize,
                                        @Param("schoolId") String schoolId);

    /**
     * @return int
     * @author YHX
     * @description 根据专业类型统计课程数
     * @date 10:35 2019/8/3
     * @Param [esId, characters]
     **/
    int selectCountCourseOfMajorIdByExamSessionId(@Param("esId") String esId,
                                                  @Param("list") List<Character> characters);

    /**
     * @return int
     * @author YHX
     * @description 统计当前考次的专业类型总数
     * @date 10:36 2019/8/3
     * @Param [esId, list]
     **/
    int selectCountMajorTypeByExamSessionId(@Param("esId") String esId,
                                            @Param("list") List<String> list);

    /**
     * @return java.util.List<com.scau.hwadee.examination.entity.Major>
     * @author YHX
     * @description 查找所有的专业，这些专业的主考院校ID不等于schoolID
     * @date 16:03 2019/8/3
     * @Param [pageNum, pageSize]
     **/
    List<Major> selectAllMajorExaminerIsNotTheSchoolId(@Param("pageNum") int pageNum,
                                                       @Param("pageSize") int pageSize,
                                                       @Param("schoolId") String schoolId);
}